\subsection{Definition}
Let \( U \subset \mathbb R, \mathbb C \).
Let \( f \) be a scalar function on \( U \).
Then for \( x \in U \), we say \( f \) is continuous at \( x \) if
\[
	\forall \varepsilon > 0, \exists \delta > 0, \forall y \in U, \abs{y-x} < \delta \implies \abs{f(y)-f(x)} < \varepsilon
\]
We say \( f \) is continuous on \( U \) if \( f \) is continuous at \( x \) for all \( x \in U \):
\[
	\forall x \in U, \forall \varepsilon > 0, \exists \delta > 0, \forall y \in U, \abs{y-x} < \delta \implies \abs{f(y)-f(x)} < \varepsilon
\]
Note here that \( \delta \) depends on \( \varepsilon \) and \( x \).
\begin{definition}
	Let \( U, f \) be as in the previous definition.
	We say \( f \) is \textit{uniformly continuous} if
	\[
		\forall \varepsilon > 0, \exists \delta > 0, \forall x, y \in U, \abs{y-x} < \delta \implies \abs{f(y) - f(x)} < \varepsilon
	\]
	Now, \( \delta \) works for all \( x \in U \) simultaneously; \( \delta \) depends on \( \varepsilon \) only.
	Certainly, uniform continuity implies continuity.
\end{definition}
\begin{example}
	Let \( f \colon \mathbb R \to \mathbb R \) such that \( f(x) = 2x + 17 \).
	Then \( f \) is uniformly continuous; given \( \varepsilon > 0 \), we can find \( \delta = \frac{1}{2} \varepsilon \).
	Then \( \forall x, y \in \mathbb R, \abs{y-x} < \delta \implies \abs{f(y)-f(x)} = \abs{2y-2x} = 2{y-x} < 2 \delta = \varepsilon \).
\end{example}
\begin{example}
	Let \( f \colon \mathbb R \to \mathbb R \), defined by \( f(x) = x^2 \).
	This is not uniformly continuous, since no \( \delta \) works for all \( x \) given some `bad' \( \varepsilon \).
	Let us take \( \varepsilon = 1 \), and we wish to show that no \( \delta \) exists.
	Suppose some \( \delta \) does exist.
	Then, let \( x > 0 \) and \( y = x + \frac{\delta}{2} \).
	We should have \( \abs{f(y) - f(x)} < 1 \).
	\[
		\qty(x + \frac{\delta}{2})^2 - x^2 = \delta x + \frac{\delta^2}{4}
	\]
	So for \( x = \frac{1}{\delta} \), this condition \( \abs{f(y) - f(x)} < 1 \) is not satisfied.
	Hence \( f \) is not uniformly continuous.
\end{example}
\begin{note}
	For \( U, f \) as in the above definition, \( f \) is not uniformly continuous on \( U \) if
	\[
		\exists \varepsilon > 0, \forall \delta > 0, \exists x, y \in U, \abs{y-x} < \delta, \abs{f(y) - f(x)} \geq \varepsilon
	\]
	So there are points arbitrarily close together whose difference of function values exceed some fixed \( \varepsilon \).
\end{note}

\subsection{Properties of continuous functions}
\begin{theorem}
	Let \( f \) be a scalar function on a closed bounded interval \( [a,b] \).
	If \( f \) is continuous on \( [a,b] \), then \( f \) is uniformly continuous on \( [a,b] \).
\end{theorem}
\begin{proof}
	Suppose there exists \( \varepsilon > 0 \) such that \( \forall \delta > 0, \exists x,y \in [a,b], \abs{y-x} < \delta, \abs{f(y)-f(x)} \geq \varepsilon \).
	In particular, we can construct a sequence \( (\delta_n) \) defined by \( \delta_n = \frac{1}{n} \), and we can construct sequences \( x_n, y_n \in [a,b] \) such that \( \abs{y_n-x_n} < \frac{1}{n} \) but \( \abs{f(y_n) - f(x_n)} \geq \varepsilon \).
	By the Bolzano--Weierstrass theorem, there exists a subsequence \( (x_{k_n}) \) that converges.
	Now, let \( x \) be the limit of the subsequence, \( \lim_{n \to \infty} x_{k_n} \).
	Then \( x \in [a,b] \) since the interval is closed.
	Then, \( \abs{y_{k_n} - x} \leq \abs{y_{k_n} - x_{k_n}} + \abs{x_{k_n} - x} < \frac{1}{n} + \abs{x_{k_n} - x} \to 0 \).
	Hence \( y_{k_n} \to x \).
	Now, since \( f \) is continuous \( f(x_{k_n}), f(y_{k_n}) \to f(x) \).
	Now, \( \varepsilon \leq \abs{f(x_{k_n}) - f(y_{k_n})} \to \abs{f(x) - f(x)} = 0 \), which is a contradiction.
\end{proof}
\begin{corollary}
	A continuous function \( f \colon [a,b] \to \mathbb R \) is Riemann integrable.
\end{corollary}
\begin{proof}
	Since a continuous function on a closed bounded interval is bounded, we have that \( f \) is bounded.
	Now, fix \( \varepsilon > 0 \), and we want to find a dissection \( \mathcal D \) such that the difference between upper and lower sums is less than \( \varepsilon \).
	By the above theorem, \( f \) is uniformly continuous.
	Hence,
	\[
		\exists \delta > 0, \forall x, y \in [a,b], \abs{y-x} < \delta \implies \abs{f(y) - f(x)} < \varepsilon
	\]
	So we must simply choose a dissection such that all intervals have size smaller than \( \delta \).
	For instance, choose some \( n \in \mathbb N \) such that \( \frac{b-a}{N} < \delta \), and then divide the interval equally into \( n \) subintervals.
	If \( I \) is an interval in this dissection, then \( \forall x,y \in I \) we have \( \abs{y-x} < \delta \) and hence \( \abs{f(y) - f(x)} < \varepsilon \).
	Hence,
	\[
		\sup_{x,y \in I} \abs{f(y) - f(x)} \leq \varepsilon
	\]
	Multiplying by the length of \( I \) and summing over all subintervals \( I \),
	\[
		U_{\mathcal D}(f) - L_{\mathcal D}(f) \leq (b-a) \varepsilon
	\]
	Hence \( f \) is Riemann integrable.
\end{proof}
